{extend name="public/base" /}

<title>{block name="title"}管理员管理{/block}</title>
{block name="menu"}
<div>
    <button type="button" class="layui-btn layui-bg-blue" id="add-adminuser">添加管理员</button>
</div>
{/block}
{block name="main"}
<!-- 右侧主信息 -->
<div class="con-box" style="padding: 1px;">
    <div style="padding: 16px;">
        <table class="layui-hide" id="user-data" lay-filter="user-data"></table>
    </div>
</div>
<div id="add-box" style="display: none;">
    <form class="layui-form" action="" lay-filter="demo-val-filter">
        <input type="hidden" name="id">
        <div class="layui-form-item">
            <label class="layui-form-label">用户名</label>
            <div class="layui-input-inline">
                <input type="text" name="username" placeholder="请输入" lay-verify="required" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">密码</label>
            <div class="layui-input-inline">
                <input type="text" name="password" placeholder="请输入" lay-verify="required" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">单行选择框</label>
            <div class="layui-input-inline">
                <select name="auth_ids" lay-filter="auth_ids">
                    <option value="">请选择</option>
                    {foreach $groupList as $key=>$vo }
                    <option value="{$vo.id}">{$vo.title}</option>
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="submit" class="layui-btn" lay-submit lay-filter="btn-save">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>
{/block}
{block name="javascript"}
<script>

    var controllername = 'admin/api_admin';
    var area = ["400px", "300px"];
    var title = '{$title}';
    var filterArray = ["username","password","auth_ids","id"];

    var cols = [ //标题栏
        { type: 'checkbox', fixed: 'left' },
        { field: 'id', title: 'ID', width: 80, sort: true },
        { field: 'username', title: '用户', width: 120 },
        { field: 'password', title: '密码', width: 300 },
        { field: 'auth_ids', title: '角色组', width: 100, templet:function(d){ return d.systemauth? d.systemauth.title:''} },
        { field: 'create_time', title: '创建时间', width: 200 },
        { fixed: 'right', title: '操作', width: 134, minWidth: 125, templet: '#toolDemo' }
    ]
</script>
{/block}